package net.flyinggroup.kafka.toroute;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.util.function.Consumer;

@SpringBootApplication
public class RoutingApplication {
    public static void main(String[] args) {
        SpringApplication.run(RoutingApplication.class,
                "--spring.cloud.stream.function.routing.enabled=true",
                "--spring.cloud.function.definition=even");
    }

    @Bean
    public Consumer<String> even() {
        return value -> System.out.println("Even:" + value);
    }

    @Bean
    public Consumer<String> odd() {
        return value -> System.out.println("Odd:" + value);
    }
}
